home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / archiver / lha201.lzh / LHAMAN.MAN < prev    next >
Text File  |  1993-01-10  |  65KB  |  1,436 lines

  1.              User's Manual for LHA v2.01 (10 January 1993)
  2.              ---------------------------------------------
  3.  
  4. Program & documentation (c) Roger Burrows, 1990-1993
  5.  
  6. Based on: LHarc version 1.13b (for MS-DOS),
  7.           copyright(c) Haruyasu Yoshizaki (Yoshi),1988-89
  8.           (documentation dated 1989-3-4)
  9. and:      The public domain AR archiver
  10.           by Haruhiko Okumura
  11.           (source file dated 14/Aug/1990)
  12.  
  13.                     I. Introduction to LHA
  14.                     ----------------------
  15.  
  16. 1. What is LHA?
  17.  
  18.   LHA is an archiving program: that is, it allows you to collect together a
  19.   number of files and store them under one file name.  This is convenient
  20.   for transferring files between users and to/from bulletin boards, as it
  21.   makes it easy to keep related files together.  Besides collecting files
  22.   together, LHA also compresses them so that they (almost always) take up
  23.   less space than they would do on their own.
  24.  
  25.   The files LHA creates are called LZH archives, since the filenames usually
  26.   end with .LZH.  This archive format was invented by a programmer in Japan,
  27.   and implemented in an MS-DOS program called LHARC.  The initial version
  28.   of LHARC (version 1.xx) compressed files using a method known as -lh1-.
  29.   Subsequently, a new compression method known as -lh5- was invented by
  30.   another Japanese programmer and MS-DOS LHARC was upgraded in version
  31.   2.xx to use this new method by default (although the original -lh1-
  32.   compression method can still be selected if desired).  LHA is based on
  33.   version 1.13b of LHARC, but has been upgraded independently to support
  34.   the new -lh5- compression method.  It has also been enhanced with a
  35.   number of extensions and a great deal of optimisation to improve its
  36.   speed.
  37.  
  38.  
  39.  
  40.  
  41. 2. Terms and Conditions
  42.  
  43.   Starting with version 1.30, LHA is available in two formats: registered
  44.   and non-registered.  Both formats have all the functions that you need
  45.   to process LZH archives, but registered copies have additional functions
  46.   to make LHA easier to use.  Registered copies are also supplied with a
  47.   a number of other programs written by myself.  Please refer to the
  48.   README.1ST file in this distribution for a list of the programs
  49.   included.
  50.  
  51.   The non-registered format may be made freely available on bulletin
  52.   boards, and I encourage you to pass it on to your friends.  However,
  53.   please note that LHA is copyrighted by Roger Burrows, and therefore
  54.   NEITHER format is in the Public Domain.
  55.  
  56.   The registered version is available from Roger Burrows at the address
  57.   given at the very end of this document.  To order, please refer to the
  58.   file README.1ST which is part of this distribution.  If you're reading
  59.   this manual as part of your registration package, thank you!  Your
  60.   contribution will encourage me to keep improving this package.
  61.  
  62.                     II. LHA Reference Manual
  63.                     ------------------------
  64.  
  65. 1. Optional command usage summary (registered users only)
  66.  
  67.   Registered copies of LHA support an optional command set which simplifies
  68.   the use of LHA in most circumstances, by assuming a standard set of
  69.   switches.  The full range of commands and switches is still available at
  70.   all times should you need them.  The syntax from a shell like Gulam is:
  71.  
  72.       LHA <command> <Archive[.LZH]> [<File> ... ]
  73.  
  74.   If you are running LHA from the Desktop, double-click on LHA.TTP, and
  75.   enter the following in the dialog box:
  76.  
  77.       <command> <Archive[.LZH]> [<File> ... ]
  78.  
  79.   In either case:
  80.       <Archive>    is the archive name; by default, the extension '.LZH'
  81.                    is assumed when modifying archives.  If listing or
  82.                    extracting from archives, the standard TOS wild-card
  83.                    characters (*,?) may be used to process multiple
  84.                    archives, and archives with extension '.LHA' as well
  85.                    as '.LZH' are examined.
  86.  
  87.       <File> ...   is one or more filenames
  88.  
  89.       <command>    is one of the following.  Note the '-' prefix which
  90.                    MUST be specified:
  91.  
  92.           -add      adds the specified files
  93.  
  94.           -backup   like -add, but also includes files from all directories
  95.                     beneath the specified directory; all file names are
  96.                     stored completely (i.e. including the full path)
  97.  
  98.           -update   adds the specified files to the archive if either:
  99.                     an older file by the same name already exists in the
  100.                     archive or: a file by the same name does not already
  101.                     exist in the archive
  102.  
  103.           -move     equivalent to -add except that files that are added
  104.                     successfully are deleted from the specified directory
  105.                     after addition
  106.  
  107.           -freshen  adds the specified files to the archive if and only
  108.                     if an older file by the same name already exists in
  109.                     the archive
  110.  
  111.           -delete   deletes the specified files from the archive
  112.  
  113.           -extract  extracts the specified files; the logical counterpart
  114.                     of the -add command
  115.  
  116.           -restore  the logical counterpart of the -backup command: will
  117.                     extract files from an archive using any directory
  118.                     information present, creating any (sub)directories 
  119.                     needed which do not exist.
  120.  
  121.           -display  like -extract, but the extracted data is displayed on
  122.                     standard output
  123.  
  124.           -print    same as -display
  125.  
  126.           -test     tests the integrity of the specified files in archive;
  127.                     equivalent to -extract except that the extracted files
  128.                     are not saved
  129.  
  130.           -list     displays information about the specified archived files
  131.                     including full path names and any attached comments
  132.  
  133.   As a convenience to the user, LHA may be invoked without arguments; one
  134.   simple way of accomplishing this is to rename LHA.TTP to LHA.TOS.  If
  135.   LHA is invoked in this way, a help message is displayed, followed by a
  136.   prompt for the command.
  137.  
  138.   If the simplified command set does not provide the exact features
  139.   required, you may use the basic command set (see section 3 below).
  140.  
  141.   A technical note to the curious: the simplified command set is
  142.   translated internally into the basic command set (the translation
  143.   used is shown along side the command name in section 2 below).  It is
  144.   therefore possible to add/override switches to the simplified command
  145.   set, although this hybrid command form is probably more confusing than
  146.   just using the basic command set with switches.
  147.  
  148.  
  149.  
  150.  
  151. 2. Detailed description of optional commands
  152.  
  153.   1) Archive modifying commands
  154.     These commands can operate on only one archive.  Wild-card characters
  155.     may NOT be used to specify the archive.
  156.  
  157.     -add (equivalent basic command: ah+t+)
  158.  
  159.         LHA -add Archive.LZH project.*
  160.  
  161.         ACTION:  all files matching 'project.*' are archived and added
  162.         to 'Archive.LZH'.  The timestamp of the archive is set equal
  163.         to that of the latest file in the archive.
  164.  
  165.         NOTE:  If the archive 'Archive.LZH' does not exist, then LHA
  166.         creates it.  If any file matching 'project.*' is already in
  167.         the archive, then LHA replaces it with the external file.
  168.  
  169.  
  170.     -backup (equivalent basic command: ah+r+t+)
  171.  
  172.         LHA -backup Archive.LZH project.*
  173.  
  174.         ACTION:  all files matching 'project.*' in the specified
  175.         directory AND all its subdirectories are archived and added
  176.         to 'Archive.LZH'.  Files are stored with full pathnames, ready
  177.         for extraction by the '-restore' command.  The timestamp of
  178.         the archive is set equal to that of the latest file in the
  179.         archive.
  180.  
  181.         NOTE:  If the archive 'Archive.LZH' does not exist, then LHA
  182.         creates it.  If any file matching 'project.*' is already in
  183.         the archive, then LHA replaces it with the external file.
  184.  
  185.  
  186.     -update (equivalent basic command: uh+t+)
  187.  
  188.         LHA -update csource file1.c file2.c
  189.  
  190.         ACTION:  'file1.c' and 'file2.c' are archived into 'csource.LZH'
  191.         exactly as though by the 'a' command, except that if either
  192.         file already exists in the archive, LHA checks the date/time
  193.         stamps of the archive version against that of the external
  194.         version.  LHA keeps the newer one and ignores the other.
  195.  
  196.  
  197.     -move (equivalent basic command: mh+t+)
  198.  
  199.         LHA -move zoom.lzh file.ext
  200.  
  201.         ACTION:  'file.ext' is archived into 'zoom.lzh' in the same
  202.         way as with the 'u' command.  If the external file 'file.ext'
  203.         is, in fact, added to the archive, then the external copy of
  204.         it is deleted.  Otherwise, the external copy is retained.
  205.  
  206.  
  207.     -freshen (equivalent basic command: fh+t+)
  208.  
  209.         LHA -freshen headers.lzh *.h
  210.  
  211.         ACTION:  if any external file that matches '*.h' already
  212.         exists in 'headers.lzh', then it will be replaced if the
  213.         external copy of the file is newer than the archive copy.
  214.  
  215.         NOTE:  This is the same as the 'u' command, except that
  216.         nothing will be done if the matching file does not already
  217.         exist in the archive.
  218.  
  219.  
  220.     -delete (equivalent basic command: dh+t+)
  221.  
  222.         LHA -delete bigarc small.txt
  223.  
  224.         ACTION:  deletes 'small.txt' from the archive 'bigarc.lzh'.
  225.  
  226.  
  227.   2) Archive extraction commands
  228.     These commands may operate on one or more archives. Multiple archives
  229.     are specified through wild-card characters.
  230.  
  231.     -extract (equivalent basic command: eh+)
  232.  
  233.         LHA -extract download.lzh *.doc
  234.  
  235.         ACTION:  extracts all files matching '*.doc' from 'download.lzh'.
  236.  
  237.         LHA -extract *
  238.  
  239.         ACTION:  extracts all files from all archives in the current
  240.         directory.
  241.  
  242.         NOTE:  If there is a file with the same name in the target
  243.         directory, then LHA refrains from extraction if the existing
  244.         file has the same time stamp or is newer.
  245.  
  246.  
  247.     -restore (equivalent basic command: eh+x+)
  248.  
  249.         LHA -restore *
  250.  
  251.         ACTION:  extracts all files from all archives in the current
  252.         directory.  If full pathnames (i.e. including subdirectories)
  253.         are present, then those subdirectories will be recreated.
  254.  
  255.         NOTE:  If there is a file with the same name in the target
  256.         directory, then LHA refrains from extraction if the existing
  257.         file has the same time stamp or is newer.
  258.  
  259.  
  260.     -display or -print (equivalent basic command: ph+)
  261.  
  262.         LHA -display sample sample.txt
  263.  
  264.         ACTION:  extracts 'sample.txt' from the archives 'sample.lzh'
  265.         and/or 'sample.lha' to the standard output.
  266.  
  267.  
  268.     -test (equivalent basic command: th+)
  269.  
  270.         LHA -test new
  271.  
  272.         ACTION:  tests specified members (in this case, all members)
  273.         of archives 'new.lzh' and/or 'new.lha', by extracting each of
  274.         them and performing a CRC check.  CRC mismatches are reported;
  275.         the extracted files are not kept.
  276.  
  277.  
  278.     -list (equivalent basic command: lh+x+c+)
  279.  
  280.         LHA -list save
  281.  
  282.         ACTION:  displays the names of each of the specified files
  283.         (in this case, all the files) in 'save.lzh' and/or 'save.lha'
  284.         together with the file size (compressed & uncompressed),
  285.         attributes, date/time, CRC value and compression method.  The
  286.         listing for each file occupies one output line, unless comments
  287.         are present, in which case an additional line is used to
  288.         display the comment.
  289.  
  290.  
  291.  
  292.  
  293. 3. Basic command usage summary (available to all users)
  294.  
  295.   The following summarises the basic command format which is available to
  296.   all users.  From a command-line shell, such as Gulam, the syntax to run
  297.   LHA is:
  298.  
  299.     LHA {aumfexpstdlv}[switches] [-[switches] ... ] <Archive[.LZH]>
  300.         [<Base directory>\ | <Base drive>:] [<File> ... ]
  301.  
  302.   If you are running LHA from the Desktop, double-click on LHA.TTP, and
  303.   enter a line with a format that matches the following:
  304.  
  305.     {aumfexpstdlv}[switches] [-[switches] ... ] <Archive[.LZH]>
  306.         [<Base directory>\ | <Base drive>:] [<File> ... ]
  307.  
  308.   [In either case, the parameters should be entered on one line; they are
  309.   split on to two lines above for readability only.]
  310.   
  311.   As a convenience to the user, LHA may be invoked without arguments; in
  312.   this case, a help message is displayed, followed by a prompt for the
  313.   command.  Otherwise, the command is entered as the first argument.
  314.  
  315.   One of the twelve listed commands {aumfexpstdlv} must be specified.
  316.   Switches (see below for a complete list) are optional; they may be
  317.   concatenated as desired, with the exception of the 'g', 'v' and 'w'
  318.   switches, which each take everything following in the string as an
  319.   argument and thus must be the last switches in a string.  Switches are
  320.   normally placed immediately following the command; however, they may
  321.   also be separated from the command and immediately preceded by a '-';
  322.   this allows for the case when you wish to specify more than one of the
  323.   'g', 'v' or 'w' switches.  Commands and switches may be entered in upper
  324.   or lower case, as desired.
  325.  
  326.   The remaining specifications may contain pathnames.  As a convenience for
  327.   those used to Un*x-style pathnames, directories may be separated by '/'
  328.   or '\' characters transparently.
  329.  
  330.   The Archive must be specified, but may be specified with or without a file
  331.   extension.  When modifying archives (commands {aumfd}), the file extension
  332.   is assumed to be .LZH if omitted; when listing or extracting from archives
  333.   (commands {expstlv}), archives with extension .LHA as well as .LZH are
  334.   processed if the file extension is omitted, and the standard TOS wild-card
  335.   characters (*,?) may be used to process multiple archives.  In order to
  336.   avoid unintentional file modification, the following safety check is made:
  337.   if the file extension is specified, and is not .LZH, and the command could
  338.   modify the archive, and the 'm' (no prompt) switch is not set, then the
  339.   user will be asked to verify the update.
  340.  
  341.   The Base directory or Base drive is optional, and is indicated by a name
  342.   ending with a '\' or ':'.  If specified, everything happens as if this
  343.   directory or drive were the current directory or drive.  Specifically:
  344.     1) when updating an archive with the 'x' switch, there will be no
  345.        record of this directory name in the archive, and
  346.     2) when extracting files from an archive, the extracted files will
  347.        be written to this directory by default.
  348.   In practice, you will probably never wish to specify this; see section 4
  349.   (concepts and terminology) for more details, and also the 'Important Note'
  350.   below.
  351.  
  352.   One or more files may be specified, either as unique filenames or with
  353.   standard GEMDOS wild-card specifications; if omitted, a default of '*.*'
  354.   (i.e. all files in the current or Base directory) is assumed for all
  355.   commands except 'd' (delete).  For safety, the filename(s) or wild-card
  356.   specification(s) must be explicitly entered for the delete command.
  357.   The case of filenames and pathnames is ignored in comparisons.  This
  358.   allows the selective extraction of files created on other systems that
  359.   support lower case in filenames (e.g. Un*x).
  360.  
  361.   As noted above, just type LHA to see the help menu.
  362.  
  363.   Important Note:
  364.   ---------------
  365.   In early versions of LHA, files could only be extracted to directories
  366.   other than the default directory by specifying a Base directory or Base
  367.   drive.  This feature was a carry-over from the original MS-DOS lharc
  368.   program.  Since this is incompatible with ARCSHELL and standard ARC
  369.   syntax, a compatibility feature was added to LHA in version 1.10.  As
  370.   of version 1.10, you may continue to use the Base drive/directory
  371.   syntax, OR you may use an ARC-like syntax:
  372.  
  373.     e myarc.lzh g:\some\abc.def
  374.  
  375.   will extract file abc.def from the 'myarc.lzh' archive into the 'g:\some'
  376.   directory.  In order for LHA to use the ARCSHELL-compatible syntax, the
  377.   following must be true:
  378.     1) the 'p' switch must be zero
  379.     2) the Base drive/directory must be omitted.
  380.  
  381.  
  382.  
  383.  
  384. 4. Detailed description of basic commands
  385.  
  386.   1) Archive modifying commands [aumfd]
  387.     These commands can operate on only one archive.  Wild-card characters
  388.     may NOT be used to specify the archive.
  389.  
  390.     a (Add)
  391.  
  392.        LHA a Archive.LZH project.*
  393.  
  394.          ACTION:  all files matching 'project.*' are archived and added
  395.          to 'Archive.LZH'.
  396.  
  397.          NOTE:  If the archive 'Archive.LZH' does not exist, then LHA
  398.          creates it.  If any file matching 'project.*' is already in
  399.          the archive, then LHA replaces it with the external file.
  400.  
  401.  
  402.     u (Update)
  403.  
  404.        LHA u csource file1.c file2.c
  405.  
  406.          ACTION:  'file1.c' and 'file2.c' are archived into 'csource.LZH'
  407.          exactly as though by the 'a' command, except that if either
  408.          file already exists in the archive, LHA checks the date/time
  409.          stamps of the archive version against that of the external
  410.          version.  LHA keeps the newer one and ignores the other.
  411.  
  412.          NOTE:  If the 'i' switch is specified, the 'u' command is
  413.          exactly the same as the 'a' command.
  414.  
  415.  
  416.     m (Move)
  417.  
  418.        LHA m zoom.lzh file.ext
  419.  
  420.          ACTION:  'file.ext' is archived into 'zoom.lzh' in the same
  421.          way as with the 'u' command.  If the external file 'file.ext'
  422.          is, in fact, added to the archive, then the external copy of
  423.          it is deleted.  Otherwise, the external copy is retained.
  424.  
  425.  
  426.     f (Freshen)
  427.  
  428.        LHA f headers.lzh *.h
  429.  
  430.          ACTION:  if any external file that matches '*.h' already
  431.          exists in 'headers.lzh', then it will be replaced if the
  432.          external copy of the file is newer than the archive copy.
  433.  
  434.          NOTE:  This is the same as the 'u' command, except that
  435.          nothing will be done if the matching file does not already
  436.          exist in the archive.  The 'i' switch may be specified to
  437.          force replacement without regard to date/time checking.
  438.  
  439.  
  440.     d (Delete)
  441.  
  442.        LHA d bigarc small.txt
  443.  
  444.          ACTION:  deletes 'small.txt' from the archive 'bigarc.lzh'.
  445.  
  446.  
  447.   2) Archive extraction commands [expstlv]
  448.     These commands may operate on one or more archives. Multiple archives
  449.     are specified through wild-card characters.
  450.  
  451.     e (Extract) or x (eXtract)
  452.  
  453.        LHA e download.lzh *.doc
  454.  
  455.          ACTION:  extracts all files matching '*.doc' from 'download.lzh'.
  456.  
  457.        LHA x *
  458.  
  459.          ACTION:  extracts all files from all archives in the current
  460.          directory.
  461.  
  462.          NOTE:  If there is a file with the same name in the target
  463.          directory, then LHA refrains from extraction if the existing
  464.          file has the same time stamp or is newer.  The 'i' switch
  465.          will force LHA to ignore the time stamp check.
  466.  
  467.  
  468.     p (disPlay) or s (diSplay)
  469.  
  470.        LHA s sample sample.txt
  471.  
  472.          ACTION:  extracts 'sample.txt' from the archives 'sample.lzh'
  473.          and/or 'sample.lha' to the standard output.
  474.  
  475.          NOTE:  The 'v' switch may be specified to allow browsing
  476.          through the output; it functions by writing the standard
  477.          output to a temporary file instead, and invoking a utility
  478.          program to browse the file; the temporary file is deleted
  479.          automatically afterwards.  The default utility invoked is
  480.          'less' (supplied with the LHA registration package), but this
  481.          may be overridden by specifying the name of the utility
  482.          immediately following the 'v' switch.  For example,
  483.              LHA pvmore archive.lzh file1.ext file2.ext
  484.          will write 'file1.ext' and 'file2.ext' to a temporary file
  485.          and invoke the 'more' command to browse it.
  486.  
  487.  
  488.     t (Test)
  489.  
  490.        LHA t new
  491.  
  492.          ACTION:  tests specified members (in this case, all members)
  493.          of archives 'new.lzh' and/or 'new.lha', by extracting each of
  494.          them and performing a CRC check.  CRC mismatches are reported;
  495.          the extracted files are not kept.
  496.  
  497.  
  498.     l (List)
  499.  
  500.        LHA l save
  501.  
  502.          ACTION:  displays the names of each of the specified files
  503.          (in this case, all the files) in 'save.lzh' and/or 'save.lha'
  504.          together with the file size (compressed & uncompressed),
  505.          attributes, date/time, CRC value and compression method.  The
  506.          listing for each file occupies one output line.
  507.  
  508.          NOTE:  The 'x' switch may be specified to cause listing of
  509.          the full stored pathname; if the stored pathname includes
  510.          subdirectories, this requires one additional line per file.
  511.          The 'c' switch may be specified to cause listing of any
  512.          stored comments; if present, this requires one additional
  513.          line per file.
  514.  
  515.  
  516.     v (Verbose list)
  517.  
  518.        LHA v foobar.xxx *.h
  519.  
  520.          ACTION:  displays the full stored pathname of each of the
  521.          files in 'foobar.xxx' (assumed to be a .LZH archive) that
  522.          has a file extension of '.h'.  The following information
  523.          is also listed: their size (compressed & uncompressed),
  524.          attributes, date/time, CRC value, compression method, and
  525.          comment (if present).
  526.  
  527.          NOTE:  This is exactly the same display as produced by the
  528.          'l' command with the 'x' switch.
  529.  
  530.  
  531.  
  532.  
  533. 5. Detailed switch description
  534.  
  535.   General:
  536.     You may specify switch(es) immediately following the command, and/or
  537.     following a '-'.  If you want to specify more than one switch, type
  538.     characters continuously without any spaces between (for example,
  539.     -rxw or -cxv).  When the switches 'g', 'v' or 'w' are used with
  540.     other switch(es), they must be specified at the end of the sequence.
  541.  
  542.     You may place a '+', '-', '1' or '0' after switches with the following
  543.     meanings:  '+' or '1' sets the switch on, and '-' or '0' sets the
  544.     switch off.  In addition, a '2' may be placed after the 'l', 'r' or 'v'
  545.     switch with a special meaning (as described later).  A switch on its
  546.     own acts as a toggle; if the option was off, it is turned on, and vice
  547.     versa.
  548.  
  549.  
  550.     a[-|+|0|1] (any Attribute)
  551.  
  552.        Applicable commands: {aum}
  553.        ACTION:  allows files with any attributes to be archived.  If
  554.        the 'a' switch is not specified, files with the Hidden or
  555.        System attribute are not included when building the list of
  556.        files to be added.  If the 'a' switch is specified, these
  557.        files are included in addition to 'Normal' and Read-Only files.
  558.        Example:
  559.            LHA aa test *.*
  560.        adds all files in the current directory to 'test.lzh',
  561.        including those with Hidden or System attributes.
  562.  
  563.  
  564.     b[-|+|0|1] (retain Backup)
  565.  
  566.        Applicable commands: {aumfd}
  567.        ACTION:  preserves the archive prior to the update as a .BAK
  568.        file.  Note that any existing .BAK file will be removed if
  569.        the update is successful.
  570.  
  571.  
  572.     c[-|+|0|1] (use Comments)
  573.  
  574.        Applicable commands: {aumflv}
  575.        ACTION:  adds or displays comments that have been stored in
  576.        a format compatible with that used by LHARC051, as follows:
  577.        a) the command is one of {aumf}.  In this case, the 'c'
  578.           switch allows comments to be tagged to a file as it is
  579.           added to the archive.  As each file is added, the user
  580.           will be prompted for a comment of up to 50 characters
  581.           in length.
  582.        b) the command is one of {lv}.  In this case, any stored
  583.           comments will be displayed as part of the output,
  584.           enclosed by square brackets [].
  585.  
  586.        NOTE 1:  Certain archivers (including LHARC102) create
  587.        archive headers that appear to contain LHARC051-style
  588.        comments, but in fact contain extension information, some
  589.        of which is non-printable.  Other archivers (including v2.xx
  590.        of MS-DOS LHARC) generate headers containing a one-byte
  591.        comment which indicates which system the header was created
  592.        on (e.g. MS-DOS, Atari TOS, Mac OS etc).  When displaying
  593.        such headers with this switch set, the displayed comment
  594.        line will contain an interpretation of the comment, rather
  595.        than a literal display of the comment data.  The interpreted
  596.        data will be enclosed in curly braces {} to indicate that
  597.        it's an interpretation.
  598.  
  599.        NOTE 2:  The 'c' switch also forces the header level of
  600.        archived files to be set to zero (see the 'l' switch for
  601.        information about header levels).
  602.  
  603.  
  604.     h[-|+|0|1] (Hold screen)
  605.  
  606.        Applicable commands: {aumfdexpstlv}
  607.        ACTION:  causes the program to wait for a keypress before
  608.        exiting.  This is mostly intended for when LHA is called
  609.        from the desktop, to allow program messages to be read
  610.        before the desktop is redisplayed.
  611.  
  612.  
  613.     i[-|+|0|1] (Ignore comparison of time stamp)
  614.  
  615.        Applicable commands: {aumfexpst}
  616.        ACTION:  causes date/time stamps of files to be ignored
  617.        when adding to, or extracting from, archives.
  618.        Example:
  619.            LHA ei old file1.ext file2.ext
  620.        extracts 'file1.ext' and 'file2.ext' from 'old.lzh',
  621.        overwriting any existing files of the same name, regardless
  622.        of date/time stamps.
  623.  
  624.  
  625.     l[-|+|0|1|2] (set header Level)
  626.  
  627.        Applicable commands: {aumf}
  628.        ACTION:  sets the format of the internal archive header, for
  629.        files added to an archive (when listing or extracting files,
  630.        the header level is automatically detected and handled
  631.        properly).  Header level 0 is compatible with previous
  632.        versions of LHA, and is the default, but headers of level 1
  633.        or 2 can be created if desired.  However, there are no
  634.        significant benefits to using header levels other than 0,
  635.        since other archivers may not be able to handle them; they
  636.        are only supported at this time for complete compatibility
  637.        with MS-DOS LHARC.
  638.  
  639.        NOTE:  When the 'o' or 'c' switch is specified, the header
  640.        level switch is automatically set to 0.
  641.  
  642.  
  643.     m[-|+|0|1] (no Message)
  644.  
  645.        Applicable commands: {aumfdexpst}
  646.        ACTION:  suppresses program prompt in the following cases:
  647.        a) the command is one of {aumfd}, the archive file
  648.           extension is specified, and it is not '.LZH'.  In this
  649.           case, the program will continue, with the (initial)
  650.           assumption that the archive file is valid.
  651.        b) the command is one of {ex}, and a directory must be
  652.           created to receive the extracted file.  In this case,
  653.           the directory will be created automatically, without
  654.           prompting the user.
  655.        c) the command is one of {ex}, and an existing file would
  656.           be overwritten by a file being extracted from the
  657.           archive (either due to a more recent time stamp, or
  658.           through specifying the 'i' switch).  In this case, the
  659.           file will be silently overwritten.
  660.        Example:
  661.            LHA xm archive temp\file1.ext
  662.        will cause LHA to create the directory 'temp' if it does
  663.        not already exist, or to overwrite the file 'file1.ext' in
  664.        directory 'temp' if it does exist, without prompting.
  665.  
  666.  
  667.     n[-|+|0|1] (No indicator)
  668.  
  669.        Applicable commands: {aumfexpst}
  670.        ACTION:  suppresses the display of the progress indicator
  671.        when compressing or decompressing files.
  672.  
  673.        NOTE: the progress indicator 'ticks' every N bytes of
  674.        uncompressed data, where N is 4096 for -lh0- and -lh1-
  675.        files and 8192 for -lh5- files.  If this would make the
  676.        indicator more than 64 bytes long, N is instead set to
  677.        (uncompressed file size)/64.
  678.  
  679.     o[-|+|0|1] (Old archive compatibility)
  680.  
  681.        Applicable commands: {aumf}
  682.        ACTION:  causes LHA to use the old style compression method
  683.        (i.e. -lh1-).  This permits compatibility with older archiving
  684.        programs, at the cost of (usually) worse compression.
  685.  
  686.        NOTE:  This also forces the header level to be set to zero
  687.        (see the 'l' switch for information about header levels).
  688.  
  689.  
  690.     p[-|+|0|1] (Precise)
  691.  
  692.        Applicable commands: {fdexpstlv}
  693.        ACTION:  allows the user to precisely distinguish between
  694.        archived files, that have the same filename but are stored
  695.        with different pathnames.  Assume an archive cc.lzh contains
  696.        both \stat.h and \sys\stat.h:
  697.            LHA e cc stat.h
  698.        will extract both files to 'stat.h' in the current directory;
  699.        as a result, the one with the older date/time stamp will be
  700.        overwritten by the other.
  701.            LHA ep cc.lzh stat.h
  702.        will extract only \stat.h to 'stat.h'.
  703.            LHA ep cc.lzh sys\stat.h
  704.        will extract only sys\stat.h to 'stat.h'.
  705.  
  706.        NOTE:  As of LHA version 1.10, specifying the 'p' switch also
  707.        has the side effect of turning off ARCSHELL compatibility;
  708.        this should not be a concern, since ARCSHELL itself never
  709.        sets the 'p' switch.
  710.  
  711.  
  712.     r[-|+|0|1|2] (Recursively search directories)
  713.  
  714.        Applicable commands: {aum}
  715.        ACTION:  recursively searches directories for files to be
  716.        archived.  If the 'r' switch is not specified, only files
  717.        in the Base or Current directory will be archived.  If the
  718.        'r' switch is specified, it selects one of two modes:
  719.        a) filename mode, if 'r' or 'r+' is specified
  720.           This disregards directory names, and adds to the archive
  721.           all the files in the Base or Current directory (and its
  722.           subdirectories) with names that match the specified
  723.           filename.
  724.        b) directory mode, if 'r2' is specified
  725.           This disregards filenames, and adds to the archive all
  726.           files under the Base or Current directory (and its
  727.           subdirectories).  This is normally used to archive a
  728.           complete directory.
  729.        Examples:
  730.            LHA ar cstuff *.c
  731.        adds to archive 'cstuff.lzh' all the files with the
  732.        extension .c under the current directory.
  733.            LHA ar2 documents.lzh \doc\
  734.        archives all the files in the \doc\ directory (and
  735.        subdirectories) into documents.lzh.  Normally used to
  736.        archive a complete directory.
  737.  
  738.        NOTE:  Switches 'r' and 'r2' automatically set the 'x'
  739.        switch.  If you wish to have 'r' or 'r2' without 'x',
  740.        set the 'x' switch off (by using 'x-') after the 'r'
  741.        or 'r2' specification.
  742.  
  743.  
  744.     t[-|+|0|1] (archive Time-stamp)
  745.  
  746.        Applicable commands: {aumfd}
  747.        ACTION:  causes the output archive to be time-stamped
  748.        with the date and time of the most recent file in the
  749.        archive, rather than the current date & time.
  750.  
  751.  
  752.     v[-|+|0|1|2|<browse command name>] (View by page)
  753.  
  754.        Applicable commands: {ps}
  755.        ACTION:  allows browsing of output produced by the 'p'/'s'
  756.        command.  Instead of copying the output to stdout, a
  757.        temporary file LHA.TMP is created, and a browse utility
  758.        is invoked to access it.  The name of the browse utility
  759.        follows the 'v' switch; if not specified, the default
  760.        browse utility is 'less'.  After the browse utility ends,
  761.        the temporary file is deleted automatically.  The standard
  762.        'v' switch generates a separator line between each file
  763.        copied to LHA.TMP so that the user can distinguish them;
  764.        the 'v2' switch suppresses this separator line.  This is
  765.        primarily to facilitate viewing binary files with a dump
  766.        utility.
  767.        Note that if a browse command name is present, the switch
  768.        is always set.  If 'v2' was specified, it remains a '2';
  769.        otherwise it is treated as 'v+'.
  770.        Examples:
  771.            LHA pv myarc *.doc
  772.        allows browsing of all '.doc' files in 'myarc.lzh', using
  773.        the 'less' utility.
  774.            LHA pv2xd hexarc
  775.        allows browsing of all files in 'hexarc.lzh', using the
  776.        'xd' utility.
  777.  
  778.  
  779.     w[-|+|0|1|<working directory name>] (set Work directory name)
  780.  
  781.        Applicable commands: {aumfdps}
  782.        ACTION:  causes any temporary files that are needed to be
  783.        created in the specified working directory (the directory
  784.        must already exist).  If no directory name is specified,
  785.        the current directory becomes the working directory.
  786.        Temporary files are needed in two circumstances:
  787.        a) the command is one of {aumfd}, and thus an archive is
  788.           being updated.  The updated archive is created in the
  789.           working directory, the old archive is deleted, and the
  790.           updated archive is put back into the current directory.
  791.           This is done by renaming the file (if possible), or by
  792.           copying the file to the current directory.
  793.        b) the command is one of {ps}, and the 'v' switch is set to
  794.           allow browsing the output.  The browse file is created
  795.           in the working directory, and deleted when the browse
  796.           utility terminates.
  797.        Note that if a work directory name is present, the switch is
  798.        always set, i.e. it is always treated as 'w+'.
  799.        Example:
  800.            LHA awm:\tmp xyzzy file1.ext file2.ext
  801.        adds 'file1.ext' and 'file2.ext' to the archive 'xyzzy.lzh',
  802.        placing the updated archive in directory 'm:\tmp' temporarily.
  803.  
  804.        There are two common uses for this feature:
  805.        1) you have no room in the directory where the .LZH file
  806.           resides, or
  807.        2) you want your work done silently and swiftly on a ram disk.
  808.  
  809.  
  810.     x[-|+|0|1] (eXtend)
  811.     z[-|+|0|1]
  812.  
  813.        Applicable commands: {aumexlv}
  814.        ACTION:  extends file names with directory names, in the
  815.        following cases:
  816.        a) the command is one of {aum}.  In this case, the 'x'
  817.           switch will include the pathname (excluding drivename)
  818.           in the filename stored in the archive.  Suppose you are
  819.           in the root directory \, and you have a file stat.h in
  820.           directory \cc\include\sys:
  821.               LHA a Archive.LZH \cc\include\sys\stat.h
  822.           will store the filename as stat.h only.
  823.               LHA ax Archive.LZH \cc\include\sys\stat.h
  824.           will store the filename as \cc\include\sys\stat.h.
  825.        b) the command is one of {ex}.  In this case, the 'x'
  826.           switch will extend the filenames so that files are
  827.           restored to the appropriate subdirectories.  Suppose
  828.           you are in the root directory \, and Archive.LZH was
  829.           created with the 'x' switch and contains the stat.h
  830.           file from directory \cc\include\sys\:
  831.               LHA e Archive.LZH stat.h
  832.           will extract the stat.h file to the current directory.
  833.               LHA ez Archive.LZH stat.h
  834.           will extract stat.h into the directory \cc\include\sys
  835.           (if one or more of the directories in the path does not
  836.           exist, you will be prompted whether to create it).
  837.        c) the command is {l}.  In this case, the full stored
  838.           pathname is listed for each member of the archive (the
  839.           'l' command with the 'x' option is exactly equivalent
  840.           to the 'v' command).
  841.  
  842.        NOTE 1:  You may specify this function with the 'z' switch
  843.        instead of the 'x' switch; they are interchangeable.  The
  844.        'z' switch is introduced in LHA v1.30 for compatibility
  845.        with the 'Include Subdirectories' feature of ARCSHELL v2.3.
  846.  
  847.        NOTE 2:  Switches 'r' and 'r2' automatically set the 'x'
  848.        switch.  If you wish to have 'r' or 'r2' without 'x', set
  849.        the 'x' switch off (by using 'x-') after the 'r' or 'r2'
  850.        specification.
  851.  
  852.  
  853.  
  854.  
  855. 6. Encryption
  856.   As of release 2.00 of LHA, encryption is only supported in a special
  857.   version of LHA, available to registered users.  This was done for two
  858.   reasons:
  859.   1) Since no other archiver currently provides encryption, most people
  860.      will probably not need this feature, and
  861.   2) There is a small performance overhead to include encryption even
  862.      when it is not used.
  863.  
  864.   When using the encryption-enabled version of LHA, the following switch
  865.   is available:
  866.  
  867.     g[-|+|0|1|<encryption key>] (set encryption key)
  868.  
  869.        Applicable commands: {aumfexpst}
  870.        ACTION:  encrypts or decrypts archive members, as follows:
  871.        a) the command is one of {aumf}, and thus an archive is
  872.           being updated.  The added members will be encrypted
  873.           with the specified encryption key as they are added.
  874.        b) the command is one of {expst}, and thus a member is
  875.           being extracted.  The extracted members will be
  876.           decrypted with the specified encryption key as they
  877.           are extracted.
  878.        Note that if an encryption key is present, the switch is
  879.        always set, i.e. it is always treated as 'g+'.
  880.        Example:
  881.            LHA agAAA new secret.txt
  882.        adds an encrypted copy of 'secret.txt' to the archive
  883.        'new.lzh'.  The copy is encrypted with the key AAA.
  884.  
  885.   In order to minimise overhead, the encryption technique used is simple,
  886.   yet it provides effective protection against casual efforts at breaking.
  887.   It is based on exclusive ORing a variable-length key with the data; the
  888.   same technique will recover the original data.
  889.  
  890.   For anyone wishing to add this feature to another archiver, the following
  891.   fragment of C code demonstrates the technique used:
  892.  
  893.   char *key;            /* ptr to start of variable-length key */
  894.   char *keyptr;         /* work ptr; NULL if no key */
  895.   /*
  896.    * crypt - encryption/decryption routine
  897.    */
  898.   int crypt(int c)      /* c is the CHARACTER to encode */
  899.   {
  900.       if (keyptr) {             /* key supplied ? */
  901.           if (!*keyptr)         /* at end of key ? */
  902.               keyptr = key;     /* yes - reinitialise */
  903.           return c^*keyptr++;   /* XOR it */
  904.       }
  905.       return c;                 /* no key, no change */
  906.   }
  907.  
  908.   Note that encryption takes place IMMEDIATELY before writing the archive
  909.   (i.e. after compression), and decryption takes place IMMEDIATELY after
  910.   reading the archive (i.e. before decompression).
  911.  
  912.  
  913.  
  914.  
  915. 7. Concepts and terminology
  916.  
  917.   1) Drive name, Path name, Directory name, File name:
  918.  
  919.   The following diagram shows the terminology used in LHA for various
  920.   components of the filename:
  921.  
  922.      drive name      file extension
  923.         ||                |<>|
  924.         c:\lc\lib\lcmasrnb.lib
  925.         |<--- path name ---->|
  926.         |<------>||<-------->|
  927.         directory     file
  928.            name       name
  929.  
  930.  
  931.   2) Base directory/drive
  932.  
  933.   This is a concept inherited from the original PC version of LHARC,
  934.   and retained since it allows for complex processing of subdirectory
  935.   structures that would not otherwise be possible.  As of LHA version
  936.   1.10, it is not necessary to use (or understand) it, UNLESS you are
  937.   extracting files using the 'p' switch (however, if you're comfortable
  938.   with the concept, don't panic: you can can still use it at any time).
  939.  
  940.   If you DO use the 'p' switch, in order to distinguish between archived
  941.   files of the same name in different subdirectories, then you WILL need
  942.   to use the Base directory/drive if you wish to restore the files to
  943.   directory(ies) other than the ones they are archived under.  The use
  944.   of Base directory/drive is probably best explained by examples.
  945.  
  946.   Example 1: to extract from an archive to another drive/directory:
  947.       lha  x  z:\temp99\boring  m:\somedir\  *.txt
  948.                                             ^
  949.                                          SEE NOTE
  950.   This extracts all .txt files from the boring archive to subdirectory
  951.   somedir of drive m:.  NOTE: there are one or more spaces between
  952.   the target directory name and the file specification.  In this example,
  953.       z:\temp99\boring     is the ARCHIVE
  954.       m:\somedir\          is the BASE directory
  955.       *.txt                is the file specification
  956.  
  957.   Example 2: suppose your archive contains a pathname of \ABC\DEF\FILE.DOC.
  958.    a) lha x archive file.doc      puts FILE.DOC into current directory
  959.    b) lha xx archive file.doc     puts FILE.DOC into subdirectory \ABC\DEF
  960.                                   within the current directory
  961.    c) lha x archive z: file.doc   puts FILE.DOC into drive Z
  962.    d) lha xx archive z: file.doc  puts FILE.DOC into subdirectory \ABC\DEF
  963.                                   within drive Z.
  964.  
  965.   You've probably noticed that neither of the above two examples uses
  966.   the 'p' switch: thus they could in fact be done by using the more
  967.   familiar syntax of ARC.  Example 1 becomes:
  968.       lha  x  z:\temp99\boring  m:\somedir\*.txt
  969.   Example 2 becomes:
  970.    a) lha x archive file.doc      puts FILE.DOC into current directory
  971.    b) lha xx archive file.doc     puts FILE.DOC into subdirectory \ABC\DEF
  972.                                   within the current directory
  973.    c) lha x archive z:file.doc    puts FILE.DOC into drive Z
  974.    d) lha xx archive z:file.doc   puts FILE.DOC into subdirectory \ABC\DEF
  975.                                   within drive Z.
  976.   However, the next example illustrates why Base directory/drive may be
  977.   required when using the 'p' switch.
  978.  
  979.   Example 3: suppose you've got an archive containing two different files,
  980.   stored with full pathnames as follows:
  981.       \abc\test.txt
  982.       \def\test.txt
  983.   and you want to extract the first one into c:\pqr\test.txt and the second
  984.   into d:\def\test.txt.  This can be done as follows:
  985.       lha xp archive c:\pqr\ \abc\test.txt
  986.       lha xp archive d:\def\ \def\test.txt
  987.   An alternative way of doing the second is:
  988.       lha xpx archive d: \def\test.txt
  989.   Of course, most people would just extract the files into the directories
  990.   named in the archive, and move them afterwards; but the code to implement
  991.   the 'p' switch was already there, and it took me hours to figure out what
  992.   it meant.  So I left the code in and tried to document its usage: who
  993.   knows, someone might use it one day !
  994.  
  995.  
  996.  
  997.  
  998. 8. Environment variables
  999.  
  1000.   The following environment variables are examined by LHA.  They are
  1001.   independent, except that the working directory may be specified by
  1002.   any of them; in case of such conflict, ARCTEMP overrides LHA which
  1003.   overrides TMP.
  1004.  
  1005.     ARCTEMP: supported in order to allow the ARCSHELL program to specify
  1006.              the working directory.  It should NOT be used otherwise,
  1007.              since LHA uses the presence of this variable to detect that
  1008.              it is being run from ARCSHELL, and thence to support "Quester
  1009.              LZH Mode" compatibility.  The working directory specified by
  1010.              ARCTEMP is overridden by that specified by the 'w' switch (if
  1011.              present) in the program arguments.
  1012.  
  1013.     LHA:     may be used to set switches.  For example, to set switches
  1014.              'x' and 'm', use:
  1015.                  LHA=xm
  1016.              The LHA environment variable is modified by program arguments.
  1017.  
  1018.     TMP:     may be used to specify the working directory.  For example,
  1019.              to set the working directory to d:\tmp, use:
  1020.                  TMP=d:\tmp\
  1021.              Note that the trailing \ in TMP is optional.  The TMP
  1022.              environment variable is overridden by the 'w' switch from
  1023.              the 'LHA' environment variable, by the ARCTEMP environment
  1024.              variable, or by the 'w' switch from program arguments.
  1025.  
  1026.  
  1027.  
  1028.  
  1029. 9. Result codes
  1030.  
  1031.   LHA returns the following result codes on termination:
  1032.         0   normal termination.
  1033.  
  1034.         1   an error has occurred:
  1035.             a) the user denied permission to update an archive file that
  1036.                did not have the standard '.LZH' extension, or
  1037.             b) some specified pathname was not used, or
  1038.             c) a header checksum error was detected in an existing archive,
  1039.                or
  1040.             d) a CRC error occurred during an unarchiving command (one of
  1041.                {expst}).  Note that, since CRCs are calculated based on the
  1042.                unarchived & non-encrypted text, specification of the wrong
  1043.                encryption key when decrypting will cause a CRC error.
  1044.  
  1045.         2   a fatal error has occurred.  In most cases, no archive will
  1046.             have been created or moved, but check the displayed error
  1047.             messages for more detailed information.
  1048.  
  1049.         3   a fatal error has occurred while copying the temporary output
  1050.             archive to the permanent output.  The original archive has
  1051.             been deleted; the temporary archive is named LHA.)2( and is
  1052.             located in the work directory specified by the 'w' switch.
  1053.             Try renaming LHA.)2( to your archive's name, although note
  1054.             that it could be damaged.
  1055.  
  1056.  
  1057.  
  1058.  
  1059. 10. Temporary Files
  1060.  
  1061.   The following filenames are used for temporary files during LHA
  1062.   processing:
  1063.  
  1064.     LHA.)1(  Old archive file after rename.
  1065.     LHA.)2(  New archive file before rename.
  1066.     LHA.TMP  Work file when the 'w' switch, or the 'p' command with the
  1067.              'v' switch, is specified.
  1068.  
  1069.   If a file with any of these names already exists, then LHA may not
  1070.   operate normally.
  1071.  
  1072.                     III. LHA Appendices
  1073.                     -------------------
  1074.  
  1075. 1. Using LHA with ARC Shell v3.1
  1076.  
  1077.   ARC Shell (by Charles F. Johnson) is a shareware GEM program which adds
  1078.   a GEM interface to archiving programs, letting you point and click to
  1079.   select the various options instead of typing a command line.  The latest
  1080.   version of ARC Shell (v3.1) has some improvements which LHA v2.01 takes
  1081.   advantage of.
  1082.  
  1083.   LHA v2.01 is now compatible with ARC Shell v3.1 in all of the basic
  1084.   functions, including subdirectory processing.  Although LHA will work
  1085.   satisfactorily in ARC shell's normal mode in many cases, it is designed
  1086.   to work with the "Quester LZH Mode" button selected.  The following
  1087.   summarises the interface betweeen LHA v2.01 and ARC Shell v3.1 (in
  1088.   Quester LZH Mode):
  1089.  
  1090.     a) The following ARC Shell buttons are fully compatible with LHA:
  1091.          Add, Move, Update, Freshen, Delete, Test, eXtract,
  1092.          copy to Stdout, List, Verbose list, Hold Screen,
  1093.          No Indicator, No Warnings, Full Paths, All Attribs,
  1094.          Skip Timestamp Comparison, Update Archive Timestamp,
  1095.          Search All Folders, Include Specified Folder, LH1 Mode
  1096.  
  1097.     b) The following ARC Shell buttons are not supported by LHA and will
  1098.        cause an error message to be issued:
  1099.          Run, cOnvert, No Compr., LARC Mode
  1100.  
  1101.     c) The 'Printer Name' for LHA on the ARC Shell configuration screen
  1102.        should be PRN:, not PRT:.
  1103.  
  1104.   If the remaining incompatibilities in (b) above are of significance
  1105.   to anyone, please let me know, since it is my objective to make LHA
  1106.   as easy to use with ARC Shell as possible.  Priority, as always, will
  1107.   be given to suggestions/comments/complaints from registered users !
  1108.  
  1109.   As an aside: ARC Shell is an excellent product that greatly simplifies
  1110.   usage of archivers from the desktop.  I strongly encourage regular
  1111.   users of it (or any other shareware product) to register: there is
  1112.   no better way to let programmers know that the products of hours of
  1113.   effort are appreciated, and to encourage them to continue.
  1114.  
  1115.  
  1116.  
  1117.  
  1118. 2. Performance
  1119.  
  1120.   A great amount of time has been spent fine-tuning the code to increase
  1121.   compression & decompression speeds.  The following tables compare LHA
  1122.   to other utilities that process .LZH files, using two different files.
  1123.   The "binary" file is actually an ARC file, and thus hard to compress;
  1124.   this file is used as an indicator of worst-case compression performance.
  1125.   The "text" file is a series of real text messages from Usenet; this file
  1126.   is used as an indicator of typical text compression performance.
  1127.  
  1128.     1) Old-style compression (-lh1-)
  1129.  
  1130.                           LHA            LHARC  LHARC
  1131.     Test                 v2.01  LZH201K   102    051   FSTLZH16  UNLZH11
  1132.     ----                 -----  -------  -----  -----  --------  -------
  1133.     Add binary file        18      14      23     26      26       n/a
  1134.     Add text file          80      56     116    143     147       n/a
  1135.     Extract binary file     9       8      18     20      25         8
  1136.     Extract text file      24      15      41     44      58        10
  1137.  
  1138.     All processing was done on a 1040 ST using a RAM disk to eliminate
  1139.     differences due to data location.  All times are in seconds.  File
  1140.     sizes (as reported by an archive list) are as follows:
  1141.  
  1142.                     Original size        Compressed size
  1143.                     -------------        ---------------
  1144.     Binary file          26719                24854
  1145.     Text file           157050                72692
  1146.  
  1147.     2) New-style compression (-lh5-)
  1148.  
  1149.                          ------------- TT030 ------------  ---- 1040 ST ---
  1150.                          --- TT RAM ---   --- ST RAM ---
  1151.                           LHA              LHA              LHA
  1152.     Test                 v2.01  LZH201K   v2.01  LZH201K   v2.01   LZH201K
  1153.     ----                 -----  -------   -----  -------   -----   -------
  1154.     Add binary file        3.7     3.4      5.6     5.0     13.1     12.2
  1155.     Add text file         19.4    16.8     32.0    26.3     75.7     68.3
  1156.     Extract binary file    1.3     1.6      1.9     2.1      4.9      4.8
  1157.     Extract text file      3.4     3.7      5.2     5.1     17.2     15.0
  1158.  
  1159.     Processing was done in an empty disk partition to eliminate differences
  1160.     due to data location.  All times are in seconds.  File sizes (as reported
  1161.     by an archive list) are as follows:
  1162.  
  1163.                     Original size        Compressed size
  1164.                     -------------        ---------------
  1165.     Binary file          26719                24788
  1166.     Text file           157050                66696
  1167.  
  1168.   The results show that times for -lh5- compression are generally less than
  1169.   those for -lh1- compression, and compressed sizes are smaller; thus there
  1170.   seems to be no reason to use old-style compression unless it is required
  1171.   for compatibility.
  1172.  
  1173.   Although archiving is clearly not a general-purpose benchmark, the results
  1174.   also provide an interesting comparison between the TT with the ST:
  1175.     1. The TT (without TT RAM) is approximately 2.3 to 3.3 times the speed
  1176.        of the ST.
  1177.     2. Executing out of TT RAM increases performance by a further 40-60%
  1178.        compared to ST RAM, giving a TT:ST ratio of between 3 and 5.
  1179.  
  1180.  
  1181.  
  1182. 3. LHA Revision History
  1183.  
  1184.   Version 1.00    First released version
  1185.  
  1186.   Version 1.10    Fixes the following bugs:
  1187.                   a) when extracting a file which already exists in the
  1188.                      target directory, the comparison for date/time was
  1189.                      incorrect; this caused the message 'Skipped xxx:
  1190.                      same or more recent file exists' to be issued when
  1191.                      it shouldn't have been, and NOT to be issued when
  1192.                      it should have been.
  1193.  
  1194.                   Changes the following design peculiarities, inherited
  1195.                   from the PC version of LHARC:
  1196.                   a) archives that contain header checksum errors, such
  1197.                      as the 'WORLD.LZH' file on GEnie, are now handled
  1198.                      with a warning message, rather than silently
  1199.                      treating such headers as end-of-archive.
  1200.                   b) extracting identically named files from archives
  1201.                      that contain subdirectories is now handled more
  1202.                      consistently (the situation in which this actually
  1203.                      changes the behaviour of LHA is so obscure that it
  1204.                      is not worth describing).
  1205.  
  1206.                   Adds the following features:
  1207.                   a) ARCSHELL compatibility when extracting files: if
  1208.                      the 'p' switch is not specified, and the 'basedir'
  1209.                      is omitted, the user may specify a fully-qualified
  1210.                      path for each file, and the file will be extracted
  1211.                      to the specified path.  The ARCTEMP environment
  1212.                      variable, which is set by ARCSHELL, is now used by
  1213.                      LHA to control placement of the working directory.
  1214.                   b) comment display, as well as comment addition, is now
  1215.                      controlled by the 'c' switch; this helps in cases
  1216.                      where the "comments" are really garbage (as in
  1217.                      archives created by LHARC102).
  1218.                   c) a smaller i/o buffer size is used when listing
  1219.                      archives; this should speed up archive display,
  1220.                      particularly on slower devices like floppies.
  1221.  
  1222.   Version 1.20    Source changed where necessary to compile under
  1223.                   Lattice C v5.04.00.
  1224.  
  1225.                   Fixes the following bugs:
  1226.                   a) output redirection is now more consistent: for
  1227.                      example, the initial title/usage messages are no
  1228.                      longer subject to redirection.
  1229.                   b) the 'a'/'u'/'m' commands can no longer erroneously
  1230.                      add the temporary file 'lha.)1(' (the temporarily-
  1231.                      renamed existing archive) when updating that archive.
  1232.                      Previously, this could have happened if the filename
  1233.                      specification allowed it (e.g. with a filename spec
  1234.                      of '*.*').
  1235.  
  1236.                   Changes the following design peculiarities, inherited
  1237.                   from the PC version of LHARC:
  1238.                   a) if moving a file to an archive (via the M command)
  1239.                      fails, due to a more recent version of the file
  1240.                      already existing in the archive, the external file
  1241.                      is no longer deleted.  This provides greater safety
  1242.                      in the event that either the archive or file
  1243.                      timestamp is wrong, or that different files have
  1244.                      inadvertently been given the same name.
  1245.  
  1246.                   Adds the following features:
  1247.                   a) the 's' command is now accepted as a synonym for
  1248.                      display: this allows LHA to display files when
  1249.                      running under ARCSHELL v2.1b.
  1250.                   b) LHA now operates more quickly, particularly when
  1251.                      extracting files.  Overall performance is around
  1252.                      5%-30% faster than LHA v1.10.
  1253.  
  1254.   Version 1.21    Fixes the following bugs:
  1255.                   a) the date/time stamp of extracted files (and of output
  1256.                      archive files when the 't' switch is specified) is
  1257.                      finally set correctly when running LHA under TOS 1.0!
  1258.                      This problem has apparently existed in all previous
  1259.                      versions of LHA.  Sincere thanks to Alexander Smith
  1260.                      for pointing this out, and apologies to everyone for
  1261.                      this long-standing major bug; my only defence is that
  1262.                      it always worked correctly under TOS 1.4.
  1263.                   b) the 'h' flag no longer causes the program to hang
  1264.                      under TOS 1.0.  This problem was introduced in v1.20.
  1265.  
  1266.   Version 1.30    Changes the following features:
  1267.                   a) the temporary file in the work directory (if present)
  1268.                      is now renamed (possibly across directories) to the
  1269.                      target file, rather than copied.  This provides some
  1270.                      performance improvement.
  1271.                   b) output from the verbose list function now occupies
  1272.                      the minimum number of lines necessary; in particular,
  1273.                      a verbose list of an archive that does not contain
  1274.                      directory information is now the same as a list of
  1275.                      the same archive.
  1276.  
  1277.                   Adds the following features:
  1278.                   a) the 'g' flag may now be used to specify an
  1279.                      encryption/decryption key.
  1280.                   b) case is ignored when matching filenames, allowing for
  1281.                      the selective extraction of archive members stored
  1282.                      under Un*x-style systems.
  1283.                   c) the extension information stored by lharc102 and
  1284.                      other Un*x-derived versions of lharc is decoded and
  1285.                      displayed when comments display is enabled.
  1286.                   d) LHA now operates more quickly when adding files.
  1287.                      Overall performance is up to 18% faster than
  1288.                      LHA v1.21.
  1289.  
  1290.   Version 2.00    Adds the following features:
  1291.                   a) -lh5- archives are now supported!  This introduces
  1292.                      a new compression method plus two new varieties of
  1293.                      internal archive header.
  1294.                   b) for downward compatibility, the 'o' flag has been
  1295.                      added.  Setting this on forces old-style (i.e. -lh1-)
  1296.                      compression to be used; otherwise, by default, -lh5-
  1297.                      archives are created.
  1298.                   c) compatibility with ARCSHELL has been greatly
  1299.                      improved.  With ARCSHELL's "Quester LZH Mode" set,
  1300.                      LHA implements all the major functions of ARCSHELL.
  1301.                   d) for compatibility with archivers on other platforms,
  1302.                      .LHA is now recognised as a valid archive extension
  1303.                      in the following circumstances: when listing or
  1304.                      extracting from an archive; and when updating an
  1305.                      archive when the 'm' switch is not set.
  1306.                   e) for compatibility with MSDOS LHARC v2.xx, the 'l'
  1307.                      flag has been added to set the header level to 0, 1
  1308.                      or 2.  By default, it is set to zero for downward
  1309.                      compatibility with earlier versions of LHA.
  1310.                   f) an id of 'A' stored as a 1-byte comment is now
  1311.                      interpreted to mean that the archive was created under
  1312.                      'Atari TOS'; this code will also be generated when an
  1313.                      archive is created, if no other comment is specified.
  1314.                   g) new error messages have been added to cover additional
  1315.                      error situations that can arise.
  1316.  
  1317.                   Fixes a minor bug: the stored file name in an archive was
  1318.                   not listed correctly if it was skipped during extraction
  1319.                   due to an unrecognised header type.
  1320.  
  1321.   Version 2.01    Fixes the following bug, introduced in v2.00:
  1322.                   a) when screen output (e.g. archive listing or file display)
  1323.                      was interrupted by pressing control-C, LHA terminated
  1324.                      abnormally, usually with 2 bombs.  This could also cause
  1325.                      system crashes.
  1326.  
  1327.  
  1328.  
  1329.  
  1330. 4. Our Distribution Policy
  1331.  
  1332.   Under the following conditions, you may freely copy and distribute
  1333.   this software:
  1334.  
  1335.     1. Under all circumstances, 'Copyright by Roger Burrows' and
  1336.        'Copyright by Haruyasu Yoshizaki' must be attached to the copy.
  1337.  
  1338.     2. This manual or its hardcopy should go together with the software.
  1339.  
  1340.     3. You must try to distribute the newest version available.
  1341.  
  1342.     4. Neither Roger Burrows nor Haruyasu Yoshizaki ("the authors")
  1343.        assume any liability for any damages, consequential or otherwise,
  1344.        that you may sustain in using this software.
  1345.  
  1346.     5. The authors have no obligation to revise the program to correct
  1347.        any fault in this software.
  1348.  
  1349.     6. For the commercial use of this software, the authors add the
  1350.        following:
  1351.  
  1352.        a. Any software that is distributed with, or incorporates, this
  1353.           program shall not be copy protected; that is, the standard copy
  1354.           functions of the GEM disktop shall be capable of making an exact
  1355.           copy.
  1356.  
  1357.        b. Every part of the package shall print the copyright banner.
  1358.  
  1359.        c. The distribution policy of this software shall be printed
  1360.           either in the manual, in the package or on the disk-label.
  1361.  
  1362.  
  1363.  
  1364.  
  1365. 5. Acknowledgments
  1366.  
  1367.   *   Principal thanks to Haruyasu Yoshizaki ('Yoshi') for placing the
  1368.       source code in the public domain, and for writing most of it in C
  1369.       (hooray for portability).  Also many thanks to Haruhiko Okumura
  1370.       for placing the code for -lh5- compression in the public domain
  1371.       (via his AR archiver).
  1372.  
  1373.   *   Further gratitude to H. Okumura who uploaded the code for LZARI in
  1374.       PCVAN on which -lh1- compression is based.  To K. Miki, who re-posted
  1375.       LZARI to Nifty Serve, and who is the author of Larc we also express
  1376.       our gratitude.  For those who contributed reports and comments and
  1377.       information on bugs in the MSDOS version, we thank you very much.
  1378.  
  1379.   *   For the Atari ST/TT version, thanks to (alphabetically) Walter Cole,
  1380.       Alan Dalgliesh, Bob Deskin, Tim Rosenquist and Alexander Smith of the
  1381.       Ottawa National Capital Atari Users Group (NCAUG) for beta testing
  1382.       various versions of this program.  Their efforts have made this a
  1383.       better program, and have encouraged me to continue to improve it.
  1384.       Special thanks to Alexander Smith for his clear and concise bug
  1385.       reports.
  1386.  
  1387.   *   Last but not least, thanks to Atari for developing the TT + 19"
  1388.       monitor, and to HiSoft for porting Lattice C to the TT environment.
  1389.       Together, they're a great development environment!
  1390.  
  1391.  
  1392.  
  1393.  
  1394. 6. Changes For The ST/TT Environment
  1395.  
  1396.   Although LHA is principally based on LHarc v1.13b, numerous changes have
  1397.   been made.  They fall into the following areas:
  1398.     1. to handle the architectural differences between Intel and Motorola
  1399.        processors; this principally affects the order of bytes in 16- and
  1400.        32-bit integers.
  1401.     2. to accommodate the different operating system; although GEMDOS is
  1402.        patterned after MSDOS, there are some differences at the lowest
  1403.        levels.
  1404.     3. to allow the use of a different compiler (currently Lattice C
  1405.        version 5.51 for the Atari ST/TT) with different library functions.
  1406.     4. to provide additional checking of error codes returned by library
  1407.        functions; I believe that all possible errors are now checked for.
  1408.     5. to split the code into more modules, for easier maintenance.
  1409.     6. to rewrite parts of the code in assembler to improve performance.
  1410.     7. to add support for storing and retrieving comments associated with
  1411.        each archive member; these are stored in a manner compatible with
  1412.        LHARC051.
  1413.     8. to add support for -lh5- archives, and various archive header
  1414.        formats.
  1415.  
  1416.   Because of the many revisions, there is a non-zero probability that
  1417.   some bugs have been introduced into the Atari version of this program
  1418.   (there may still be bugs lurking from the PC version).  I would
  1419.   appreciate your comments and bug reports.  Please route them to me
  1420.   via the following addresses:
  1421.  
  1422.     1) GEnie:                Userid: R.BURROWS1
  1423.  
  1424.     2) BBS:                  NCAUG Bulletin Board (613) 738-2887
  1425.        (1200/2400 baud)      Userid: Roger Burrows
  1426.  
  1427.     3) Snail-mail:           Roger Burrows
  1428.                              Anodyne Software
  1429.                              6 Cobbler Court
  1430.                              Ottawa
  1431.                              Ontario K1V 0B8
  1432.                              Canada
  1433.  
  1434.   Bug reports and suggestions from registered owners will be handled
  1435.   first, but I will endeavour to fix any bugs reported by any user.
  1436.